package org.ndx.majick.ui;

import java.util.Collection;
import java.util.Map;

import javax.swing.JComponent;
import javax.swing.JPanel;

import org.ndx.majick.properties.Property;

/**
 * A panel provider will create and return a panel from an object and a property set
 * @author Nicolas Delsaux
 *
 */
public interface IPanelProvider {

	/**
	 * Gets the panel representing the given object, used to edit the given set of properties, 
	 * with both rendering components and labels configured and i18ned
	 * @param mode rendering mode. Can be {@link IUIProvider#VIEWER} or {@link IUIProvider#EDITOR} 
	 * @param object edited object
	 * @param properties object edited properties
	 * @param propertiesToLabels map linking properties to labels used to show them
	 * @param propertiesToRenderers map linking properties to their rendering components
	 * @return a panel allowing view or edit of the given set of properties
	 */
	JPanel getPanel(String mode, Object object,
			Collection<Property<?>> properties,
			Map<Property<?>, JComponent> propertiesToLabels,
			Map<Property<?>, JComponent> propertiesToRenderers);

}
